#ifndef NAMELISTER_H
#define NAMELISTER_H

#include <vector>
#include <sstream>

#include "name.h"
#include "file.h"
#include "types.h"

//typedef to help prevent carpal tunnel.
typedef std::vector<Name*> NAMELIST;

//NameLister class used to generate NameList.
class NameLister
{
    public:
        //setup NameLister object.
        NameLister();

        //destructor. clean up dynamically allocated remains.
        ~NameLister();

        //Uses input file to generate/append to itsNameList.
        void GenerateNameList(File& file);

        //return itsNameList
        NAMELIST GetNameList();

    private:

        //Scans for incoming names and if found, sets up a Name object and stores the type.
        //Asignes Type value
        Name* Stage1(std::stringstream* FileBufferSS);

        //Assumes name is a Stage1() created name object and assignes a name/identifier to it.
        //Also asignes Type2 value.
        void Stage2(Name* name, std::stringstream* FileBufferSS);

        //Assumes name was processed by stage2() and assignes an id and a Type3 value.
        void Stage3(Name* name, std::stringstream* FileBufferSS);

        //vector to hold Name pointers.
        NAMELIST itsNameList;

        //id numver counter.
        UINT itsIdCounter;

};

#endif // NAMELISTER_H
